/**
 * Bakalarska prace - Inteligentni budik
 * @package sleepCatcher
 * @file SCFormManager.h
 * @author Jan Pesava - xpesav00
 * @email xpesav00@stud.fit.vutbr.cz
 * @date 24. 12. 2011
 */

#ifndef _SCFormManager_H_
#define _SCFormManager_H_

#include <FBase.h>
#include <FUi.h>

#include "models/SCBaseModel.h"

using namespace Osp::Base;
using namespace Osp::Ui;
using namespace Osp::Ui::Controls;
using namespace Osp::Base::Collection;
using namespace Osp::App;

class SCFormManager : public SCBaseObject
{

// Construction
private:
	SCFormManager(void);
	virtual ~SCFormManager(void);
public:
	static result Construct();
	static result Destruct();


// Attributes
public:
	static Form *pCurrentForm;
	static Integer currentFormId;
	static HashMapT<int, Form*> *pOpenForms;
	static bool appOnBackground;
	static bool screenSaver;

// Constants
public:
	//Alarm
	static const RequestId IDF_ALARM 						= 100;
	static const RequestId IDF_ALARM_SET 					= 101;
	static const RequestId IDF_ALARM_DELETE		 			= 102;
	static const RequestId IDF_ALARM_REPEAT		 			= 103;
	static const RequestId IDF_ALARM_NAME		 			= 104;
	static const RequestId IDF_ALARM_AWAKE_TYPE	 			= 105;
	static const RequestId IDF_ALARM_AWAKE_SOUND			= 106;
	static const RequestId IDF_ALARM_AWAKE		 			= 107;
	static const RequestId IDF_ALARM_RING		 			= 108;
	//Settings
	static const RequestId IDF_SETTINGS						= 120;
	//static const RequestId IDF_SETTINGS_LANGUAGE			= 121;
	static const RequestId IDF_SETTINGS_INTELLIGENT_SLEEP	= 122;
	static const RequestId IDF_SETTINGS_SLEEP_LENGTH		= 123;
	//CatchSleep
	static const RequestId IDF_CATCH_SLEEP					= 140;
	//Sessions
	static const RequestId IDF_SESSIONS						= 150;
	static const RequestId IDF_SESSIONS_DETAIL				= 151;
	static const RequestId IDF_SESSIONS_DELETE				= 152;
	static const RequestId IDF_SESSIONS_INFO				= 153;
	//Statistics
	static const RequestId IDF_STATISTICS					= 170;

	//SlideId
	static const RequestId NO_SLIDE							= 196;
	static const RequestId SLIDE_LEFT						= 197;
	static const RequestId SLIDE_RIGHT						= 198;
	static const RequestId FADE_IN_OUT						= 199;


// Methods
public:
	static bool SetStarterForm(RequestId requestId, ArrayList* pArgs);
	static bool SwitchToForm(RequestId requestId,  bool removeCurrent, ArrayList* pArgs, int slideType);
	static bool SlideToForm(RequestId requestId, bool removeCurrent, Osp::Base::Collection::IList* pArgs);
	static void RemoveForm(Form* pForm, Integer pLastFormId, bool deleteForm);
	static Form* CreateForm(RequestId formId, ArrayList* pArgs);
	static Form* GetForm(RequestId formId, ArrayList* pArgs);
	static ArrayList* GetNeighboringFormsId(RequestId formId);
	static void CreateNeighboringForms(RequestId formId, ArrayList* pArgs);
	static void CreateBaseForms();
	static RequestId GetCurrentFormId();
	static Form* GetCurrentForm();
	static void Redraw();
};

#endif	//_SCFormManager_H_
